import java.util.Arrays;
import java.util.Random;

public class MinAndMax {
    private static double min;
    private static double max;

    public double getMin() {
        return min;
    }


    public double getMax() {
        return max;
    }

    static class GetMinAndMax{

        static MinAndMax getResult(double[] arr){
            MinAndMax minAndMax=new MinAndMax();
            int n=arr.length;
            Arrays.sort(arr);
            min=arr[0];
            max=arr[n-1];
            return minAndMax;
        }

        public double getMin() {
            return min;
        }


        public double getMax() {
            return max;
        }

    }
}

class Test{
    public static void main(String[] args) {
        double[] arr = new double[10];
        Random random = new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i] = random.nextDouble() * 100;
        }

        for (double num : arr) {
            System.out.println(num);
        }
        MinAndMax result = MinAndMax.GetMinAndMax.getResult(arr);
        System.out.println("最小值:\n"+ result.getMin());
        System.out.println("最大值:\n"+ result.getMax());
    }
}